public class This01 {


    public static void main(String[] args) {

        Dog dog1 = new Dog("大壮",3);
        System.out.println("dog1的hashcode == "+dog1.hashCode());
        dog1.show();

        Dog dog2 = new Dog();
        System.out.println(dog2);
        dog1.info();
    }

}

class Dog{
    String name;
    int age;

    public  Dog(String name,int age){
        this.name = name;
        this.age = age;
    }

    public Dog(){
        System.out.println("无参构造器");
    }

    public void show(){
        System.out.println(name + " " + age);
    }

    public void info(){
        System.out.println(this.hashCode());
    }
}
